import Cookies from 'js-cookie';

export const COOKIE_TOKEN_KEY = 'token';

export const clearAllCoolies = (): void => {
  Cookies.remove(COOKIE_TOKEN_KEY);
};

export const getTokenFromCookie = (): string | undefined => {
  return Cookies.get(COOKIE_TOKEN_KEY);
};

export const saveTokenToCookie = (token: string): void => {
  Cookies.set(COOKIE_TOKEN_KEY, token, { expires: 1 });
};
